const { Sequelize } = require('sequelize');
const {
  MYSQL_HOST,
  MYSQL_PORT,
  MYSQL_USER,
  MYSQL_PWD,
  MYSQL_DB
} = require('../config/config.dev');

const seq= new Sequelize(MYSQL_DB, MYSQL_USER,MYSQL_PWD, {
  host: MYSQL_HOST,
  dialect: 'mysql',
  pool: {
    max: 5,
    min: 0,
    idle: 10000
  },
  logging:true,
  timezone: '+08:00'
});
module.exports = seq;
  // seq
  //   .authenticate()
  //   .then(()=>{
  //     console.log('Connection has been established successfully.');
  //   })
  //   .catch(err =>{
  //     console.log('Unable to connect to the database:', err);
  //   })
  

  
